<template>
	<view>
<!-- 		<u-tabbar :list="loginId=='10' ? 'generalUser' : loginId=='11' ? 'admin' : 'courier'" :active-color="activeColor" :inactive-colot="inactiveColor"></u-tabbar> -->
		<u-tabbar :list="User" :active-color="activeColor" :inactive-colot="inactiveColor"></u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				activeColor: "#55a0ff", // 选中时的颜色
				inactiveColor: "#000", // 未选中时的颜色
				loginId:'',
				User:'',
				generalUser: [{
						text: "应用",
						pagePath: "/pages/application/application",
						iconPath: "/static/icon/Vector-1.png",
						selectedIconPath: "/static/icon/Vector.png"
					},
					{
						text: "通讯录",
						pagePath: "/pages/mail_list/mail_list",
						iconPath: "/static/icon/Vector-3.png",
						selectedIconPath: "/static/icon/Vector-2.png"
					},
					{
						text: "工作台",
						pagePath: "/pages/workbench/workbench",
						iconPath: "/static/icon/Vector-5.png",
						selectedIconPath: "/static/icon/Vector-4.png"
					},
					{
						text: "工单",
						pagePath: "/pages/work_order/work_order",
						iconPath: "/static/icon/Union-1.png",
						selectedIconPath: "/static/icon/Union.png"
					},
					{
						text: "我的",
						pagePath: "/pages/my/my",
						iconPath: "/static/icon/Group1275.png",
						selectedIconPath: "/static/icon/Group16.png"
					}
				],
				admin: [{
						text: "通讯录",
						pagePath: "/pages/mail_list/mail_list",
						iconPath: "/static/icon/Vector-3.png",
						selectedIconPath: "/static/icon/Vector-2.png"
					}, {
						text: "工单",
						pagePath: "/pages/work_order/work_order",
						iconPath: "/static/icon/Union-1.png",
						selectedIconPath: "/static/icon/Union.png"
					},
					{
						text: "我的",
						pagePath: "/pages/my/my",
						iconPath: "/static/icon/Group1275.png",
						selectedIconPath: "/static/icon/Group16.png"
					}
				],
				courier: [{
						text: "通讯录",
						pagePath: "/pages/mail_list/mail_list",
						iconPath: "/static/icon/Vector-3.png",
						selectedIconPath: "/static/icon/Vector-2.png"
					}, {
						text: "工单",
						pagePath: "/pages/work_order/work_order",
						iconPath: "/static/icon/Union-1.png",
						selectedIconPath: "/static/icon/Union.png"
					},
					{
						text: "我的",
						pagePath: "/pages/my/my",
						iconPath: "/static/icon/Group1275.png",
						selectedIconPath: "/static/icon/Group16.png"
					}
				],
				current: 0
			}
		},
		 // onShow() {
		 //            console.log('888888888888888')
		 //        },
	// 	onReady() {
	// 		console.log('11111111')
	// 		// console.log('11111')
	// 		// this.loginId = uni.getStorageSync("userType")
	// 		// console.log(this.loginId)
	// 		// if(this.loginId=='10'||!this.loginId) {
	// 		// 	this.User=this.generalUser
	// 		// } else if(this.loginId=='11') {
	// 		// 	this.User=this.admin
	// 		// } else if (this.loginId=='12') {
	// 		// 	this.User=this.courier
	// 		// }
			
	// 	},
		created() {
			this.getData()
				// this.loginId = uni.getStorageSync("userType")
				// console.log(this.loginId)
				// console.log('2222222')
				// if(this.loginId=='10'||!this.loginId) {
				// 	this.User=this.generalUser
				// } else if(this.loginId=='11') {
				// 	this.User=this.admin
				// } else if (this.loginId=='12') {
				// 	this.User=this.courier
				// }
		},
		// beforeDestroy() {
		// 	this.generalUser=[]
		// 	this.admin=[]
		// 	this.courier=[]
		// 	console.log('-----------------------------------------------')
		// },
		
	// 	onLoad() {
 // console.log('333333333')
	// 	},
	// 	onShow() {
	// 		console.log('444444')
	// 	},
		methods: {
			 getData(){
				this.loginId = uni.getStorageSync("userType")
				// console.log(this.loginId)
				console.log('2222222')
				if(this.loginId=='2'||!this.loginId) {
					this.User=this.generalUser
				} else if(this.loginId=='1') {
					this.User=this.admin
				} else if (this.loginId=='0') {
					this.User=this.courier
				}
				
			},
		}
	}
</script>
